package com.example.azheng.rxjavamvpdemo.net;


import com.example.azheng.rxjavamvpdemo.bean.BaseResponseBean;
import com.example.azheng.rxjavamvpdemo.bean.RegisterBean;

import io.reactivex.Flowable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Headers;
import retrofit2.http.POST;

/**
 * @author azheng
 * @date 2018/4/24.
 * GitHub：https://github.com/RookieExaminer
 * Email：wei.azheng@foxmail.com
 * Description：
 */
public interface APIService {

    /**
     * 登陆
     *
     * @param username 账号
     * @param password 密码
     * @return
     */
    @FormUrlEncoded
    @POST("member/register")
    @Headers("Content-Type:application/x-www-form-urlencoded; charset=utf-8")
    Flowable<BaseResponseBean<RegisterBean>> register(@Field("username") String username,
                                                      @Field("password") String password,
                                                      @Field("password_confirm") String password_confirm,
                                                      @Field("email") String email
    );

}
